<template>
  <div class="table-container">
    <Head @search="search" v-model:show-allocated-modal="showAllocatedModal" />
    <StationTable></StationTable>
    <a-modal
      v-model:visible="showStation"
      :draggable="true"
      :title="t['操作']"
      :footer="false"
      :mask-closable="false"
      width="800px"
    >
      <StationForm />
    </a-modal>
  </div>
</template>

<script setup lang="ts">
import { getStationList, resetQuery, showStation, stationQuery } from "./data";
import StationForm from "./form/Form.vue";
import { resetForm } from "./form/data";
import StationTable from "./table/Table.vue";

import Head from "./head/Head.vue";

const t = translate("公共模块");
const showAllocatedModal = ref(false);
const search = () => {
  stationQuery.value.pageNum = 1;
  getStationList();
};
/* 转移，入库 */
// const translateProps = {
//   upload: {
//     migration: "/station/station/shift/xlsx",
//     storage: "/station/station/warehouse/xlsx"
//   },
//   download: {
//     migration: "/station/station/shift/xlsx",
//     storage: "/station/station/warehouse/xlsx"
//   }
// };

onMounted(() => {
  getStationList();
});

onUnmounted(() => {
  resetForm();
  resetQuery();
});
</script>

<style scoped lang="scss"></style>
